﻿namespace Sgr.Sms.TencentCloud
{
    /// <summary>
    /// 腾讯云短信配置选项
    /// </summary>
    public class TencentCloudSmsOptions
    {
        /// <summary>
        /// 腾讯云账户访问密钥 Id
        /// </summary>
        public string SecretId { get; set; } = string.Empty;

        /// <summary>
        /// 腾讯云账户访问密钥 Key
        /// </summary>
        public string SecretKey { get; set; } = string.Empty;

        /// <summary>
        /// 短信应用ID
        /// </summary>
        public string SdkAppId { get; set; } = string.Empty;

        /// <summary>
        /// 短信签名
        /// </summary>
        public string SignName { get; set; } = string.Empty;

        /// <summary>
        /// 短信模板ID
        /// </summary>
        public string TemplateId { get; set; } = string.Empty;

        /// <summary>
        /// 地域
        /// </summary>
        public string Region { get; set; } = "ap-guangzhou";

        public void CopyFrom(TencentCloudSmsOptions? envOptions)
        {
            if (envOptions != null)
            {
                this.SecretId = envOptions.SecretId;
                this.SecretKey = envOptions.SecretKey;
                this.SdkAppId = envOptions.SdkAppId;
                this.SignName = envOptions.SignName;
                this.TemplateId = envOptions.TemplateId;
                this.Region = envOptions.Region;
            }
        }
    }
}